package com.warthur.jfinal.demo.config;

import com.jfinal.config.Constants;
import com.jfinal.config.Interceptors;
import com.jfinal.json.Jackson;
import com.warthur.jfinal.demo.interceptor.GlobalActionInterceptor;
import io.jboot.core.JbootCoreConfig;

/**
 * @author warthur
 * @date 2019/10/07
 */
public class JfinalConfig extends JbootCoreConfig {

    @Override
    public void configConstant(Constants constants) {
        super.configConstant(constants);
        constants.setJsonFactory(Jackson::new);
    }

    @Override
    public void configInterceptor(Interceptors interceptors) {
        super.configInterceptor(interceptors);
        interceptors.add(new GlobalActionInterceptor());
    }
}
